package com.example.lib_login.view

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import com.example.lib_login.LoginViewModel
import com.example.lib_login.databinding.AgreementBinding
import com.example.lib_login.view.AgreementView
import com.google.android.material.bottomsheet.BottomSheetDialogFragment

class WjbDialogView(val viewModel: LoginViewModel):BottomSheetDialogFragment() {
    private lateinit var binding:AgreementBinding

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = AgreementBinding.inflate(inflater)
        return binding.root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        binding.disagreeBtn.setOnClickListener {
            viewModel.agreementImageView.set(false)
            dismiss()
        }

        binding.agreeBtn.setOnClickListener {
            viewModel.agreementImageView.set(true)
            dismiss()
        }
    }

}